<template>
  <div>
    <!-- 租房信息列表 -->
    <div v-if="rentals.length > 0" class="rental-list">
      <el-card v-for="rental in rentals" :key="rental._id">
        <div slot="header" class="rental-header">{{ rental.address }}</div>
        <div class="rental-body">
          <p>租房时间：{{ rental.rentalTime }}</p>
          <p>房租：{{ rental.rent }}</p>
          <p>房屋户型：{{ rental.houseType }}</p>
          <p>房屋简述：{{ rental.description }}</p>
          <p>房东信息：{{ rental.landlordInfo }}</p>
        </div>
      </el-card>
    </div>

    <!-- 无租房信息提示 -->
    <div v-if="rentals.length === 0" class="no-results">暂无租房信息</div>
  </div>
</template>

<script setup>
const rentals = [
  {
    _id: 1,
    address: '北京市朝阳区',
    rentalTime: '2024年4月',
    rent: '5000元/月',
    houseType: '两室一厅',
    description: '精装修，配套设施齐全',
    landlordInfo: '联系电话：123456789'
  },

];
</script>

<style scoped>
/* 样式省略，与之前相同 */
</style>
